package com.example.administrator.gynews.adapter;

import android.content.Context;
import android.support.v4.app.NavUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.administrator.gynews.R;
import com.example.administrator.gynews.bean.ClassMate;

import java.util.List;

/**
 * Created by Administrator on 2019/9/26.
 */

public class ClassMateListVIewAdapter extends BaseAdapter{
    Context context;
    List<ClassMate.ListBean> beanList;
    public ClassMateListVIewAdapter(Context context,List<ClassMate.ListBean> beanList){
        this.context = context;
        this.beanList = beanList;

    }
    @Override
    public int getCount() {
        return beanList.size();
    }

    @Override
    public Object getItem(int position) {
        return beanList.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        convertView =   View.inflate(context, R.layout.classmate_listview_item, null);
        TextView stuName = (TextView) convertView.findViewById(R.id.classmate_name);
        stuName.setText(beanList.get(position).getName()+"");

        return convertView;
    }
}
